home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 31 / PC Actual CD 31.iso / dists / SRC / SLIBEXEC.AA / SLIBEXEC / libexec / bootpd / hwaddr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-22  |  1.0 KB  |  45 lines

  1. /* 
  2.  * hwaddr.h
  3.  *
  4.  *    $Id: hwaddr.h,v 1.4 1997/02/22 14:21:07 peter Exp $
  5.  */
  6.  
  7. #ifndef    HWADDR_H
  8. #define HWADDR_H
  9.  
  10. #define MAXHADDRLEN        8    /* Max hw address length in bytes */
  11.  
  12. /*
  13.  * This structure holds information about a specific network type.  The
  14.  * length of the network hardware address is stored in "hlen".
  15.  * The string pointed to by "name" is the cononical name of the network.
  16.  */
  17. struct hwinfo {
  18.     unsigned int hlen;
  19.     char *name;
  20. };
  21.  
  22. extern struct hwinfo hwinfolist[];
  23. extern int hwinfocnt;
  24.  
  25. #ifdef    __STDC__
  26. #define P(args) args
  27. #else
  28. #define P(args) ()
  29. #endif
  30.  
  31. extern void setarp P((int, struct in_addr *, int, u_char *, int));
  32. extern char *haddrtoa P((u_char *, int));
  33. extern void haddr_conv802 P((u_char *, u_char *, int));
  34.  
  35. #undef P
  36.  
  37. /*
  38.  * Return the length in bytes of a hardware address of the given type.
  39.  * Return the canonical name of the network of the given type.
  40.  */
  41. #define haddrlength(type)    ((hwinfolist[(int) (type)]).hlen)
  42. #define netname(type)        ((hwinfolist[(int) (type)]).name)
  43.  
  44. #endif    /* HWADDR_H */
  45.